package com.lwj.liwanjia.view.activity.myindent;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.view.View;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.lwj.liwanjia.R;
import com.lwj.liwanjia.adapter.indent.JiudianAdapter;
import com.lwj.liwanjia.base.BaseActivity;
import com.superrecycleview.superlibrary.recycleview.SuperRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by Administrator on 2017/9/28.
 */

public class JdUnorederDetailActivity extends BaseActivity {

    @BindView(R.id.status_bar)
    RelativeLayout statusBar;
    @BindView(R.id.iv_left)
    ImageView ivLeft;
    @BindView(R.id.tv_left)
    TextView tvLeft;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.iv_right)
    ImageView ivRight;
    @BindView(R.id.tv_right)
    TextView tvRight;
    @BindView(R.id.head_layout)
    RelativeLayout headLayout;
    @BindView(R.id.iv_pay_state)
    ImageView ivPayState;
    @BindView(R.id.tv_pay_state)
    TextView tvPayState;
    @BindView(R.id.pay_state)
    LinearLayout payState;
    @BindView(R.id.tv_price)
    TextView tvPrice;
    @BindView(R.id.ll_price)
    LinearLayout llPrice;
    @BindView(R.id.detail_head)
    RelativeLayout detailHead;
    @BindView(R.id.iv_jiudian_icon)
    ImageView ivJiudianIcon;
    @BindView(R.id.tv_jiudian)
    TextView tvJiudian;
    @BindView(R.id.rl_head)
    RelativeLayout rlHead;
    @BindView(R.id.line)
    View line;
    @BindView(R.id.rlv_jiudian)
    SuperRecyclerView rlvJiudian;
    @BindView(R.id.line2)
    View line2;
    @BindView(R.id.tv_jiudian_zongjia)
    TextView tvJiudianZongjia;
    @BindView(R.id.tv_sum)
    TextView tvSum;
    @BindView(R.id.rl_zongjia)
    RelativeLayout rlZongjia;
    @BindView(R.id.tv_bianhao)
    TextView tvBianhao;
    @BindView(R.id.tv_detail_bianhao)
    TextView tvDetailBianhao;
    @BindView(R.id.rl_bianhao)
    RelativeLayout rlBianhao;
    @BindView(R.id.tv_yuyue_time)
    TextView tvYuyueTime;
    @BindView(R.id.tv_detail_yuyuetime)
    TextView tvDetailYuyuetime;
    @BindView(R.id.rl_yuyue_time)
    RelativeLayout rlYuyueTime;
    @BindView(R.id.tv_yuyue_ren)
    TextView tvYuyueRen;
    @BindView(R.id.tv_detail_yuyueren)
    TextView tvDetailYuyueren;
    @BindView(R.id.rl_yuyue_ren)
    RelativeLayout rlYuyueRen;
    @BindView(R.id.tv_phone)
    TextView tvPhone;
    @BindView(R.id.tv_detail_phone)
    TextView tvDetailPhone;
    @BindView(R.id.rl_phone)
    RelativeLayout rlPhone;
    @BindView(R.id.tv_renshu)
    TextView tvRenshu;
    @BindView(R.id.tv_detail_renshu)
    TextView tvDetailRenshu;
    @BindView(R.id.rl_renshu)
    RelativeLayout rlRenshu;
    @BindView(R.id.tv_liuyan)
    TextView tvLiuyan;
    @BindView(R.id.tv_detal_liuyan)
    TextView tvDetalLiuyan;
    @BindView(R.id.rl_liuyan)
    RelativeLayout rlLiuyan;
    @BindView(R.id.tv_quxiao_indent)
    TextView tvQuxiaoIndent;
    @BindView(R.id.tv_minute)
    TextView tvMinute;
    @BindView(R.id.tv_second)
    TextView tvSecond;
    @BindView(R.id.ll_topay)
    LinearLayout llTopay;
    @BindView(R.id.tv_call)
    TextView tvCall;
    @BindView(R.id.ll_bottom)
    LinearLayout llBottom;
    private List<String> list = new ArrayList<>();
    private JiudianAdapter jiudianAdapter;
    private String type;

    @Override
    protected void initView() {
        type = getIntent().getStringExtra("type");
        tvLeft.setVisibility(View.VISIBLE);
        tvTitle.setText("订单详情");
        llTopay.setVisibility(View.GONE);
        tvCall.setVisibility(View.VISIBLE);
        ivPayState.setImageResource(R.mipmap.daifahuo);
        if(type.equals("待接单")) {
            tvPayState.setText("待接单");
            tvPrice.setText("等待商家接单...");
            tvCall.setText("联系商家");
        }else if(type.equals("已接单")){
            tvPayState.setText("已接单");
            tvPrice.setText("商家已接单...");
            tvCall.setText("确认用餐");
            tvQuxiaoIndent.setText("转外卖");
        }
        LinearLayoutManager manager = new LinearLayoutManager(this);
        manager.setOrientation(LinearLayoutManager.VERTICAL);
        rlvJiudian.setLayoutManager(manager);
        rlvJiudian.setRefreshEnabled(false);
        rlvJiudian.setLoadMoreEnabled(false);
        jiudianAdapter = new JiudianAdapter(this, list);
        rlvJiudian.setAdapter(jiudianAdapter);
    }

    @Override
    protected void initData() {
        list.add("1");
        list.add("1");
        list.add("1");
        list.add("1");
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_jiu_dian_detail;
    }


    @OnClick(R.id.tv_left)
    public void onViewClicked() {
        finish();
    }

}
